package com.papper.common.config;

import com.papper.common.cache.local.PapperLRUCache;

/**
 * @Author:Lajiao
 * @Date:2014年5月20日
 * @Time:下午5:58:45
 * @Description:本地参数配置信息
 */
public class LoginConfig {
    private static LoginConfig                    instance = null;
    private static PapperLRUCache<String, String> lruCache = new PapperLRUCache<String, String>(10000);

    private LoginConfig() {
    }

    public static synchronized LoginConfig I() {
        if (instance == null) {
            instance = new LoginConfig();
            instance.initPropertys();
        }
        return instance;
    }

    public void initPropertys() {
        lruCache.clear();
    }

    public String getSession(String key) {
        String rtn = lruCache.get(key);
        if (rtn != null) {
            return rtn;
        }
        return rtn;
    }

    public void putSession(String key, String value) {
        lruCache.put(key, value);
    }
}
